-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Adds terms querying functionality for the CorePostTerms Block. #339
Conversation
🦋 Changeset detectedLatest commit: 03ef8c2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
includes/Blocks/CorePostTerms.php
Outdated
public function __construct( WP_Block_Type $block, Registry $block_registry ) { | ||
parent::__construct( $block, $block_registry ); | ||
|
||
foreach ( self::STRING_FIELDS as $field ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like an unnecessary abstraction. I'd recommend using register_graphql_fields()
(plural) directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@justlevine Good idea.
I’ve updated the code to remove the extra method call and directly register fields inside register_graphql_fields()
. The abstraction has been minimized, but get_string_field_config()
is still used for maintainability
…ted changeset comment.
… eliminates abstraction and class constant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
@whoami-pwd it would be nice if we had a unit test to cover this query as well
… fields registration; changes description and field name to proper ones.
Description
Related issue: #180
Adds terms querying functionality for the CorePostTerms Block.
New
terms
fieldconnection registered.Resolves as a list_of TermNodeNew
taxonomy
connection registered.Additionally adds support for the
prefix
andsuffix
items with correspondent newly registered string fields.